import com.alibaba.fastjson.JSON

/**
 *@ClassName ActiviteTeacherSkillRecords
 *@Description 业务用途
 *@Author zhongzihao
 *@Date 2022/1/5 2:56 下午
 *@Version 1.0
 **/
class ActivityTeacherSkillRecords {
    var classEducationStory: List<ActivityRecords> = emptyList()
    var classManagementMethod: List<ActivityRecords> = emptyList()
    var themeClassMeetingDesign: List<ActivityRecords> = emptyList()
}

class ActivityRecords {
    //作品标题
    var title: String = ""

    //教师名字
    var teacherName: String = ""

    //封面图片
    var coverImage: String = ""

    //得票数
    var votes: Int = 0

    //分组 ActivityTeacherGroupEnum枚举
    var group: Int = 0

    var resourceId: String = ""

    //头像
    var avatar: String = ""
}

class ActivityTeacherRecommendRecordContent {
    //顶部图片，第一张
    var topImage: String = ""

    //web端顶部图片
    var webTopImage:String = ""

    //视频url
    var videoUrl: String = ""

    //课件url
    var coursewareUrl: String = ""

    //web端的切图
    var webImages:List<String> = emptyList()

    //切图数组
    var images: List<String> = emptyList()
}

fun main(){
    test()
}

fun test() {
    val sql =
        "INSERT INTO `ep_activity_teacher_recommend_record` (`record_id`, `votes`, `content`, `create_time`, `update_time`, `deleted`) VALUES \n" +
                "\t('%s',0,'%s','2022-01-06 12:44:44','2022-01-06 12:44:44',0);"
    val model = build()
    println(String.format(sql, model.recordId, model.json))
}

fun build(): buildModel {
    val record = ActivityTeacherRecommendRecordContent().apply {
        this.coursewareUrl = "https://store-tg1.cvte.com/easicare-v2-test/ad590df5eef6402ba4386e22e495e62f"
        this.topImage = "https://store-g1.seewo.com/FrnSgSLy03Y7BRj1dE4ZWjvOb28d"
        this.images = listOf(
            "https://store-g1.seewo.com/Fj5eEQRuz1iKDAVqU34MY7fWUlZK",
            "https://store-g1.seewo.com/FrnSgSLy03Y7BRj1dE4ZWjvOb28d"
        )
        this.webImages = listOf(
            "https://store-g1.seewo.com/Fj5eEQRuz1iKDAVqU34MY7fWUlZK",
            "https://store-g1.seewo.com/FrnSgSLy03Y7BRj1dE4ZWjvOb28d"
        )
        this.webTopImage = "https://store-g1.seewo.com/FrnSgSLy03Y7BRj1dE4ZWjvOb28d"
        this.videoUrl = ""
    }
    val json = JSON.toJSONString(record)
    System.err.println(json)
    return buildModel().apply {
        this.json = json
    }
}

class buildModel {
    var recordId = ""
    var json = ""
}


